#
# Copyright (C) 2016-2023 GitHub 
#
# This is free software, licensed under the GNU General Public License v3.
# See /LICENSE for more information.

include $(TOPDIR)/rules.mk

PKG_NAME:=honzon-default-settings
PKG_VERSION:=2
PKG_RELEASE:=35
PKG_LICENSE:=GPLv3
PKG_LICENSE_FILES:=LICENSE

include $(INCLUDE_DIR)/package.mk

define Package/honzon-default-settings
  SECTION:=luci
  CATEGORY:=LuCI
  TITLE:=LuCI support for Default Settings
  PKGARCH:=all
  DEPENDS:=+luci-base +luci +@LUCI_LANG_zh-cn
endef

define Package/honzon-default-settings/description
	Language Support Packages.
endef

define Package/honzon-default-settings/config
  select BUSYBOX_CUSTOM
  select BUSYBOX_CONFIG_TELNET
  select BUSYBOX_CONFIG_FEATURE_TELNET_TTYPE
  select BUSYBOX_CONFIG_FEATURE_TELNET_AUTOLOGIN
  select BUSYBOX_CONFIG_FEATURE_TELNET_WIDTH
endef

define Build/Compile
endef
define Package/$(PKG_NAME)/preinst
	#!/bin/sh
	# if NOT run buildroot then stop service
	exit 0 
endef

define Package/honzon-default-settings/install
	$(INSTALL_DIR) $(1)/etc/uci-defaults
	$(INSTALL_BIN) ./files/zzz-default-settings $(1)/etc/uci-defaults/99-honzon-default-settings
	$(INSTALL_DIR) $(1)/usr/sbin
	$(INSTALL_BIN) ./files/4g-init  $(1)/usr/sbin/4g-init
	$(INSTALL_DIR) $(1)/etc/udhcpc.user.d
	$(INSTALL_BIN) ./files/10-lan-ipaddr  $(1)/etc/udhcpc.user.d/10-lan-ipaddr
	$(INSTALL_DIR) $(1)/etc/hotplug.d/usb
	$(INSTALL_BIN) ./files/01_init4g.sh  $(1)/etc/hotplug.d/usb/01_init4g.sh
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) ./files/inotifysync-tinc.sh  $(1)/usr/bin/inotifysync-tinc.sh
	$(INSTALL_DIR) $(1)/usr/sbin
	$(INSTALL_BIN) ./files/get_app.sh  $(1)/usr/sbin/get_app.sh
endef

$(eval $(call BuildPackage,honzon-default-settings))
